<?php
if( IN_MANAGER_MODE != "true" ){
	die( '<strong>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the MODx Content Manager instead of accessing this file directly.' );
}
/* !
** jSam - Действия
*/
$jSamAction = preg_replace( '/[^0-9]/i', '', isset( $_REQUEST[ 'jsam' ] ) ? $_REQUEST[ 'jsam' ] : 0 );
$jSam -> data[ 'jSamAction' ] = $modx -> manager -> jSamAction = $jSamAction = is_numeric( $jSamAction ) ? $jSamAction : 0;
if( $jSamAction != 0 ){
	$modx -> invokeEvent( 'OnJsamAction', array( 'action' => $jSamAction ) );
	global $modx_lang_attribute, $modx_lang_attribute, $modx_textdir, $modx_manager_charset, $manager_theme, $_lang, $_style, $SystemAlertMsgQueque;
	$_path = preg_replace( '/[^\.\/a-z]/i', '', isset( $_REQUEST[ 'path' ] ) ? $_REQUEST[ 'path' ] : '' );
	switch( $jSamAction ){
		/********************************************************************/
		/* Include Actions **************************************************/
		/********************************************************************/
		
		// Действие №1 - Подключение файла $_REQUEST[ 'path' ] и обворачивание в оболочку страницы админки MODx
		case 1:
			include( $modx -> config[ 'base_path' ].'manager/includes/header.inc.php' );
			if( $_path != '' ){
				include( $_path );
			}
			include( $modx -> config[ 'base_path' ].'manager/includes/footer.inc.php' );
			break;
		
		// Действие №2 - Подключение файла $_REQUEST[ 'path' ]
		case 2:
			if( $_path != '' ){
				include( $_path );
			}
			break;
		
		/********************************************************************/
		/* AJAX *************************************************************/
		/********************************************************************/
		
		// Действие №11 - Подключение файла autocomplete.php
		case 11:
			include( 'autocomplete.php' );
			break;
		
		/********************************************************************/
		/* Default **********************************************************/
		/********************************************************************/
		default:
			break;
	}
}
?>